#include "StdAfx.h"
#include "ModulatorTextProvider.h"

ModulatorTextProvider::ModulatorTextProvider(void)
{
	modulatorText = NULL;
	textLength = 0;
}

ModulatorTextProvider::~ModulatorTextProvider(void)
{
	if(modulatorText)
	{
		delete modulatorText;
	}
}

char* ModulatorTextProvider::GetModulatorText()
{
	char* copy = NULL;
	if(modulatorText)
	{	
		copy = new char[textLength+1];
		strcpy(copy, modulatorText);
	}
	return copy;
}

void ModulatorTextProvider::UpdateModulatorText(const char* text)
{
	if(modulatorText) delete modulatorText;
	if(text)
	{
		textLength = strlen(text);
		modulatorText = new char[textLength+1];
		strcpy(modulatorText, text);	
	}
	else
	{
		textLength = 0;
		modulatorText = NULL;
	}
}
